package com.tyk.bookstore.front.product.model.query;


import com.tyk.bookstore.front.common.core.model.query.PageQuery;
import com.tyk.bookstore.front.product.model.enume.BookSortOrder;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * @author tyk
 * @description 通用搜素查询条件
 */
@Data
public class CommonSearchQuery extends PageQuery {

    @Schema(description = "关键词")
    private String keyword;

    @Schema(description = "书名（模糊）")
    private String nameLike;

    @Schema(description = "价格：起始")
    private BigDecimal priceFrom;

    @Schema(description = "价格：终止")
    private BigDecimal priceTo;

    @Schema(description = "作者姓名（模糊）")
    private String authorNameLike;

    @Schema(description = "出版社ID")
    private String publisherId;

    @Schema(description = "出版时间：起始时间")
    private LocalDateTime publishTimeFrom;

    @Schema(description = "出版时间：终止时间")
    private LocalDateTime publishTimeTo;

    @Schema(description = "ISBN")
    private String isbn;

    @Schema(description = "分类ID（一级/二级/三级）")
    private String classificationId;

    @Schema(description = "排序方式[1综合，2销量，3价格，4评论数]")
    @NotNull
    private BookSortOrder sortOrder;

    @NotNull
    @Schema(description = "是否降序")
    private Boolean desc;
}
